#include "AssesmentAction.h"

AssesmentAction::AssesmentAction(double degree/*,VisioneController *visione*/):ArAction("AlignAction", "Si allinea alla palla") {

	this->degree = degree;
	//this->aligned = false;
	//this->visione = visione;
}

AssesmentAction::~AssesmentAction() {

}

ArActionDesired* AssesmentAction::fire(ArActionDesired currentDesired){

	myDesired.reset();
	double toRotate = -1;
	int range = 5;
	if(degree<0)
		toRotate=1;

	if(degree<-range || degree >range){
		degree = degree+toRotate;
		myRobot->setDeltaHeading(toRotate);
	}

	return &myDesired;

}


